package fragments;

import java.util.Calendar;

import activities.SetMatchScheduleActivity;
import activities.SetMatchTimeRangeActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import dataFormat.TimeDayPair;

public class SetMatchScheduleFragment extends ScheduleControlFragment {
	public SetMatchScheduleFragment(boolean isAddScheduleEnabled, Calendar weekCal) {
		super(isAddScheduleEnabled, weekCal);
	}

	@Override
	protected void clickAddSchedule(View view) {
		Bundle bundle = new Bundle();
		Intent intent = new Intent(getActivity(), SetMatchTimeRangeActivity.class);
		TimeDayPair tdPair = getImgTimeDayPairMap().get(view);
		
		bundle.putInt("hour", tdPair.getTime());
		bundle.putInt("day", tdPair.getDay());
		intent.putExtras(bundle);
		getActivity().startActivityForResult(intent,
				((SetMatchScheduleActivity)getActivity()).SET_MATCH_TIME_RANGE_REQUEST_CODE);
	}
}
